import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import Topic from "../views/Topic.vue";
import Catalog from "../views/Catalog.vue";
import Cart from "../views/Cart.vue";
import User from "../views/User.vue";
import Productdetail from "../views/Productdetail.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect:"/Home"
  },
  {
    path: "/Home",
    name: "Home",
    component: Home,
  },
  {
    path: "/Topic",
    name: "Topic",
    component: Topic,
  },
  {
    path: "/Catalog",
    name: "Catalog",
    component: Catalog,
  },
  {
    path: "/Cart",
    name: "Cart",
    component: Cart,
  },
  {
    path: "/User",
    name: "User",
    component: User,
  },
  {
    path: "/Productdetail/:id",
    name: "Productdetail",
    props: true,
    component: Productdetail,
  },
  // {
  //   path: "/about",
  //   name: "About",
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () =>
  //     import(/* webpackChunkName: "about" */ "../views/About.vue"),
  // },
];

const router = new VueRouter({
  routes,
});

export default router;
